package com.harry.service;

import com.harry.mapper.OtherMapper;
import com.harry.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.web.ConditionalOnEnabledResourceChain;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class OtherService
{
    @Resource
    OtherMapper otherMapper;

    @Resource
    UserMapper userMapper;

    public String registerUser(String age, String name, String open_id, String phoneNumber, String role)
    {
        if(userMapper.login(open_id) != null)
            return "已注册";
        otherMapper.registerUser(age, name, open_id, phoneNumber, role);
        return "success";
    }

    public void forwardStage(String open_id)
    {
        otherMapper.forwardStage(open_id);
    }
}
